// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 新增用户 新增用户 POST /user/addUser */
export async function addUserUsingPost(
  body: dataFactory.AddUserDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/user/addUser', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 根据用户ID删除用户 DELETE /user/deleteUser/${param0} */
export async function deleteUserUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.deleteUserUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/user/deleteUser/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查询用户 根据用户ID查询用户 GET /user/getUser/${param0} */
export async function getUserUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.getUserUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/user/getUser/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查询用户列表 查询所有用户 GET /user/listUsers */
export async function listUsersUsingGet(options?: { [key: string]: any }) {
  return request<dataFactory.R>('/user/listUsers', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 更新用户 更新用户信息 PUT /user/updateUser */
export async function updateUserUsingPut(
  body: dataFactory.UpdateUserDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/user/updateUser', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
